package main

import (
    "facecat"
    "io/ioutil"
)

var gPaint = facecat.CreatePaint()

func WndProc(hwnd facecat.HWND, msg uint32, wParam, lParam uintptr) (result uintptr) {
    return facecat.WndProcDefault(gPaint, hwnd, msg, wParam, lParam)
}

func main() {
    facecat.CreateMainWindow(gPaint, "FaceCat-Go", WndProc)
    xmlStr, _ := ioutil.ReadFile("xml//labelexample.xml")
    facecat.RenderFaceCat(gPaint, string(xmlStr))
    //获取第二页
    tabPage := facecat.FindViewByName("TabPage2", gPaint.Views)
    label := facecat.CreateView("label")
    label.Location = facecat.CreatePoint(100, 100)
    label.Size = facecat.CreateSize(100, 20)
    facecat.AddViewToParent(label, tabPage)
    label.Text = "标签"
    facecat.ShowWindow(gPaint)
}